<?php
	require_once "config.php";
	$content = empty($_GET['id']) ? '' : "content.php?id={$_GET['id']}";
	$one_sql = $mysql->query("select * from dyspw_weblinktype where parentid = 0 and checkinfo = 'true' order by orderid ");
	$one_type = $one_sql->fetch_all(MYSQLI_ASSOC);
	$fenlei = array();
	foreach ($one_type as $key => $val) {
		$two_sql = $mysql->query("select * from dyspw_weblinktype where parentid = {$val['id']} and checkinfo = 'true'");
		$two_type = $two_sql->fetch_all(MYSQLI_ASSOC);
		$fenlei[$key]['one'] = $val;
		$fenlei[$key]['two'] = $two_type;
	}
	// print_r($fenlei);exit;
?>
<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
	<title>分类</title>
	<link rel="stylesheet" href="css/core.css">
	<script src="js/jquery-2.2.4.min.js" type="text/javascript"></script>
	<script src="js/jquery.cookie.js" type="text/javascript"></script>
	<script src="js/layer/layer.js" type="text/javascript"></script>
	<script src="js/dsbridge.js" type="text/javascript"></script>
	<script src="js/app-login.js" type="text/javascript"></script>
	<style media="screen">
		.fenlei_img li{width:49%;float: left; margin-bottom: 5px;}
		.fenlei_img li:nth-child(n){margin-left:1%;}
		.fenlei_img li img{width: 100%; }
	</style>
<script>


var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?cb5d49b07e0a753dc8ee27ba2c73495d";
  var s = document.getElementsByTagName("script")[0];
  s.parentNode.insertBefore(hm, s);
})();
</script>
</head>
<body>
<section style="padding-bottom:50px;">
	<div class="main" style="width:90%;">
		<div class="header-box" style="height:50px;">
			<h2>分类</h2>
		</div>
		<ul class="fenlei_img">
			<li><a href="shop_list.php?sort=12"><img src="images/fenlei_yule.png" alt=""></a></li>
			<li><a href="shop_list.php?sort=10"><img src="images/fenlei_meishi.png" alt=""></a></li>
			<li><a href="shop_list.php?sort=92"><img src="images/fenlei_waimai.png" alt=""></a></li>
			<li><a href="shop_list.php?sort=95"><img src="images/fenlei_meirong.png" alt=""></a></li>
			<li><a href="shop_list.php?sort=16"><img src="images/fenlei_jiaoyu.png" alt=""></a></li>
			<li><a href="shop_list.php?sort=17"><img src="images/fenlei_jianshen.png" alt=""></a></li>
			<li><a href="shop_list.php?sort=94"><img src="images/fenlei_dianzi.png" alt=""></a></li>
			<li><a href="shop_list.php?sort=89"><img src="images/fenlei_jiancai.png" alt=""></a></li>
			<li><a href="shop_list.php?sort=97"><img src="images/fenlei_nongfu.jpg" alt=""></a></li>
			<li><a href="shop_list.php?sort=93"><img src="images/fenlei_qita.png" alt=""></a></li>
		</ul>
	</div>
</section>
<footer style="background:#FFF;">
	<ul class="cl">
        <li><a href="index.php">首页</a></li>
        <li><a href="fenlei.php">分类</a></li>
        <li><a href="baishe.php">拍</a></li>
        <li><a href="shopping.php">商城</a></li>
        <li><a href="member.php">我</a></li>
	</ul>
</footer>
<script type="text/javascript">
$(function(){

	/*判断手机端左滑右滑动*/
	$("body").on("touchstart", function(e) {
		startX = e.originalEvent.changedTouches[0].pageX,
		startY = e.originalEvent.changedTouches[0].pageY;
	});
	$("body").on("touchend", function(e) {
		moveEndX = e.originalEvent.changedTouches[0].pageX,
		moveEndY = e.originalEvent.changedTouches[0].pageY,
		X = moveEndX - startX,
		Y = moveEndY - startY;
		if(X > 100){//左滑
			location.href = '<?php echo $content?>';
		}else if(X < -100){//右滑
	        location.href = 'member.php';
	    }
	});


	$(".list-more").click(function(){
		if($(this).parent().parent().hasClass("menuhide")){
			$(this).parent().parent().removeClass("menuhide");
		}else{
			$(this).parent().parent().addClass("menuhide");
		}
	});
});
</script>
</body>
</html>
